﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace SingletonUnit
{

    public class BaseSingleton
    {
        private DateTime _CreateTime;
        public DateTime CreateTime { get { return _CreateTime; } }
        protected BaseSingleton()
        {
            _CreateTime = DateTime.Now;
            Console.WriteLine("当前线程：" + Thread.CurrentThread.ManagedThreadId + "," + _CreateTime.ToString("yyyyMMddHHmmss.") + _CreateTime.Ticks + ",初始化：" + this.GetType().FullName);
        }
    }
    public enum SingletonType
    {
        Simple = 1,
        ThreadSafeNoLock = 2,
        ThreadSafe = 3,
        DoubleCheckedLocking = 4,
        Lazy = 5,
        DotNetLazy = 6,
    }
}
